/*
 * Copyright 2012-2020 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.springframework.boot.autoconfigure.web.reactive;

import org.springframework.web.reactive.result.method.annotation.RequestMappingHandlerAdapter;
import org.springframework.web.reactive.result.method.annotation.RequestMappingHandlerMapping;

/**
 * 接口：用于注册 {@link WebFluxAutoConfiguration} 中的关键组件，以替代 Spring WebFlux 提供的默认组件。
 * <p>
 * 所有自定义实例稍后将由 Spring Boot 和 Spring WebFlux 配置处理。
 * 应该只注册该组件的一个实例，否则将导致无法从多个 WebFlux 组件中做出选择。
 *
 * @author Artsiom Yudovin
 * @since 2.1.0
 * @see org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration.EnableWebFluxConfiguration
 */
public interface WebFluxRegistrations {

	/**
	 * 返回应由 WebFlux 配置使用和处理的自定义 {@link RequestMappingHandlerMapping}。
	 * @return 自定义的 {@link RequestMappingHandlerMapping} 实例
	 */
	default RequestMappingHandlerMapping getRequestMappingHandlerMapping() {
		return null;
	}

	/**
	 * 返回应由 WebFlux 配置使用和处理的自定义 {@link RequestMappingHandlerAdapter}。
	 * @return 自定义的 {@link RequestMappingHandlerAdapter} 实例
	 */
	default RequestMappingHandlerAdapter getRequestMappingHandlerAdapter() {
		return null;
	}

}
